package com.ohos.connent.bizscenecloud.biz.modular.dp.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * 状态
 *
 **/
@Getter
public enum StatusEnum {

    /**
     * 待提交
     */
    TO_BE_SUBMITTED("0","待提交"),
    /**
     * 待审核
     */
    TO_BE_REVIEWED("1","待审核"),
    /**
     * 审核通过
     */
    APPROVED("2","审核通过"),
    /**
     * 审核驳回
     */
    OVERRULE("3","审核驳回");

    private final String key;

    private final String value;

    StatusEnum(String key,String value) {
        this.key = key;
        this.value = value;
    }

    public static StatusEnum getByKey(String key) {
        if (StringUtils.isEmpty(key)) {
            return null;
        }
        for (StatusEnum statusEnum : StatusEnum.values()) {
            if (StringUtils.equals(statusEnum.key,key)) {
                return statusEnum;
            }
        }
        return null;
    }
}
